<template>
  <div class="update-gender">
    <van-picker
      show-toolbar
      :columns="columns"
      :default-index="defaultIndex"
      @cancel="$emit('close')"
      @confirm="onConfirm"
    ></van-picker>
  </div>
</template>

<script>
export default {
  name: 'UpdateGender',
  component: {},
  props: {
    value: {
      type: Number,
      required: true
    }
  },
  data () {
    return {
      value: '',
      columns: ['男', '女'],
      defaultIndex: this.value
    }
  },
  methods: {
    onConfirm (value) {
      this.value = value
      this.$emit('close')
    }
  }
}
</script>

<style>
</style>
